package pack1.homework;

class Point {
    double x, y, z;

    public double distance(Point p) {
        double a = Math.sqrt((p.x - x) * (p.x - x) + (p.y - y) * (p.x - x) + (p.z - z) * (p.z - z));
        return a;
    }

    public Point(double a, double b, double c) {
        x = a;
        y = b;
        z = c;
    }
}

public class Port {
    public static void main(String[] args) {
        Point p1 = new Point(1, 2, 3);
        Point p2 = new Point(4, 5, 6);
        double result = p1.distance(p2);
        System.out.println("Distance between two points is:" + result);
    }
}